﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media.Effects;
using System.Windows.Media;
using System.Windows;

namespace ShaderPad
{
    class CustomShaderEffect : ShaderEffect
    {
        public CustomShaderEffect(PixelShader shader)
        {
            PixelShader = shader;
            UpdateShaderValue(InputProperty);
            UpdateShaderValue(Tex1Property);
            UpdateShaderValue(Tex2Property);
            UpdateShaderValue(Tex3Property);
            //UpdateShaderValue(Tex4Property);
            //UpdateShaderValue(Tex5Property);
            //UpdateShaderValue(Tex6Property);
            //UpdateShaderValue(Tex7Property);
            //UpdateShaderValue(Tex8Property);
            //UpdateShaderValue(Tex9Property);
            //UpdateShaderValue(Tex10Property);
            //UpdateShaderValue(Tex11Property);
            //UpdateShaderValue(Tex12Property);
            //UpdateShaderValue(Tex13Property);
            //UpdateShaderValue(Tex14Property);
            //UpdateShaderValue(Tex15Property);

            UpdateShaderValue(Val0Property);
            UpdateShaderValue(Val1Property);
            UpdateShaderValue(Val2Property);
            UpdateShaderValue(Val3Property);
            UpdateShaderValue(Val4Property);
            UpdateShaderValue(Val5Property);
            UpdateShaderValue(Val6Property);
            UpdateShaderValue(Val7Property);
            UpdateShaderValue(Val8Property);
            UpdateShaderValue(Val9Property);
            UpdateShaderValue(Val10Property);
            UpdateShaderValue(Val11Property);
            UpdateShaderValue(Val12Property);
            UpdateShaderValue(Val13Property);
            UpdateShaderValue(Val14Property);
            UpdateShaderValue(Val15Property);
            UpdateShaderValue(Val16Property);
            UpdateShaderValue(Val17Property);
            UpdateShaderValue(Val18Property);
            UpdateShaderValue(Val19Property);
            UpdateShaderValue(Val20Property);
            UpdateShaderValue(Val21Property);
            UpdateShaderValue(Val22Property);
            UpdateShaderValue(Val23Property);
            UpdateShaderValue(Val24Property);
            UpdateShaderValue(Val25Property);
            UpdateShaderValue(Val26Property);
            UpdateShaderValue(Val27Property);
            UpdateShaderValue(Val28Property);
            UpdateShaderValue(Val29Property);
            UpdateShaderValue(Val30Property);
            UpdateShaderValue(Val31Property);
        }

        public Brush Input
        {
            get { return (Brush)GetValue(InputProperty); }
            set { SetValue(InputProperty, value); }
        }

        public static readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(CustomShaderEffect), 0);

        public Brush Tex1
        {
            get { return (Brush)GetValue(Tex1Property); }
            set { SetValue(Tex1Property, value); }
        }

        public static readonly DependencyProperty Tex1Property = ShaderEffect.RegisterPixelShaderSamplerProperty("Tex1", typeof(CustomShaderEffect), 1);




        public Brush Tex2
        {
            get { return (Brush)GetValue(Tex2Property); }
            set { SetValue(Tex2Property, value); }
        }

        // Using a DependencyProperty as the backing store for Tex2.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Tex2Property =
            ShaderEffect.RegisterPixelShaderSamplerProperty("Tex2", typeof(CustomShaderEffect), 2);




        public Brush Tex3
        {
            get { return (Brush)GetValue(Tex3Property); }
            set { SetValue(Tex3Property, value); }
        }

        // Using a DependencyProperty as the backing store for Tex3.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Tex3Property =
            ShaderEffect.RegisterPixelShaderSamplerProperty("Tex3", typeof(CustomShaderEffect), (3));



        //public Brush Tex4
        //{
        //    get { return (Brush)GetValue(Tex4Property); }
        //    set { SetValue(Tex4Property, value); }
        //}

        //// Using a DependencyProperty as the backing store for Tex4.  This enables animation, styling, binding, etc...
        //public static readonly DependencyProperty Tex4Property =
        //    ShaderEffect.RegisterPixelShaderSamplerProperty("Tex4", typeof(CustomShaderEffect), (4));



        //public Brush Tex5
        //{
        //    get { return (Brush)GetValue(Tex5Property); }
        //    set { SetValue(Tex5Property, value); }
        //}

        //// Using a DependencyProperty as the backing store for Tex5.  This enables animation, styling, binding, etc...
        //public static readonly DependencyProperty Tex5Property =
        //    ShaderEffect.RegisterPixelShaderSamplerProperty("Tex5", typeof(CustomShaderEffect), (5));




        //public Brush Tex6
        //{
        //    get { return (Brush)GetValue(Tex6Property); }
        //    set { SetValue(Tex6Property, value); }
        //}

        //// Using a DependencyProperty as the backing store for Tex6.  This enables animation, styling, binding, etc...
        //public static readonly DependencyProperty Tex6Property =
        //    ShaderEffect.RegisterPixelShaderSamplerProperty("Tex6", typeof(CustomShaderEffect), (6));



        //public Brush Tex7
        //{
        //    get { return (Brush)GetValue(Tex7Property); }
        //    set { SetValue(Tex7Property, value); }
        //}

        //// Using a DependencyProperty as the backing store for Tex7.  This enables animation, styling, binding, etc...
        //public static readonly DependencyProperty Tex7Property =
        //    ShaderEffect.RegisterPixelShaderSamplerProperty("Tex7", typeof(CustomShaderEffect), (7));


        //public Brush Tex8
        //{
        //    get { return (Brush)GetValue(Tex8Property); }
        //    set { SetValue(Tex8Property, value); }
        //}

        //// Using a DependencyProperty as the backing store for Tex8.  This enables animation, styling, binding, etc...
        //public static readonly DependencyProperty Tex8Property =
        //    ShaderEffect.RegisterPixelShaderSamplerProperty("Tex8", typeof(CustomShaderEffect), (8));


        //public Brush Tex9
        //{
        //    get { return (Brush)GetValue(Tex9Property); }
        //    set { SetValue(Tex9Property, value); }
        //}

        //// Using a DependencyProperty as the backing store for Tex9.  This enables animation, styling, binding, etc...
        //public static readonly DependencyProperty Tex9Property =
        //    ShaderEffect.RegisterPixelShaderSamplerProperty("Tex9", typeof(CustomShaderEffect), (9));


        //public Brush Tex10
        //{
        //    get { return (Brush)GetValue(Tex10Property); }
        //    set { SetValue(Tex10Property, value); }
        //}

        //// Using a DependencyProperty as the backing store for Tex10.  This enables animation, styling, binding, etc...
        //public static readonly DependencyProperty Tex10Property =
        //    ShaderEffect.RegisterPixelShaderSamplerProperty("Tex10", typeof(CustomShaderEffect), (10));


        //public Brush Tex11
        //{
        //    get { return (Brush)GetValue(Tex11Property); }
        //    set { SetValue(Tex11Property, value); }
        //}

        //// Using a DependencyProperty as the backing store for Tex11.  This enables animation, styling, binding, etc...
        //public static readonly DependencyProperty Tex11Property =
        //    ShaderEffect.RegisterPixelShaderSamplerProperty("Tex11", typeof(CustomShaderEffect), (11));



        //public Brush Tex12
        //{
        //    get { return (Brush)GetValue(Tex12Property); }
        //    set { SetValue(Tex12Property, value); }
        //}

        //// Using a DependencyProperty as the backing store for Tex12.  This enables animation, styling, binding, etc...
        //public static readonly DependencyProperty Tex12Property =
        //    ShaderEffect.RegisterPixelShaderSamplerProperty("Tex12", typeof(CustomShaderEffect), (12));


        //public Brush Tex13
        //{
        //    get { return (Brush)GetValue(Tex13Property); }
        //    set { SetValue(Tex13Property, value); }
        //}

        //// Using a DependencyProperty as the backing store for Tex13.  This enables animation, styling, binding, etc...
        //public static readonly DependencyProperty Tex13Property =
        //    ShaderEffect.RegisterPixelShaderSamplerProperty("Tex13", typeof(CustomShaderEffect), (13));


        //public Brush Tex14
        //{
        //    get { return (Brush)GetValue(Tex14Property); }
        //    set { SetValue(Tex14Property, value); }
        //}

        //// Using a DependencyProperty as the backing store for Tex14.  This enables animation, styling, binding, etc...
        //public static readonly DependencyProperty Tex14Property =
        //    ShaderEffect.RegisterPixelShaderSamplerProperty("Tex14", typeof(CustomShaderEffect), (14));

        //public Brush Tex15
        //{
        //    get { return (Brush)GetValue(Tex15Property); }
        //    set { SetValue(Tex15Property, value); }
        //}

        //// Using a DependencyProperty as the backing store for Tex15.  This enables animation, styling, binding, etc...
        //public static readonly DependencyProperty Tex15Property =
        //    ShaderEffect.RegisterPixelShaderSamplerProperty("Tex15", typeof(CustomShaderEffect), (15));




        public double Val0
        {
            get { return (double)GetValue(Val0Property); }
            set { SetValue(Val0Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val0Property = DependencyProperty.Register("Val0", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(0)));

        public double Val1
        {
            get { return (double)GetValue(Val1Property); }
            set { SetValue(Val1Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val1Property = DependencyProperty.Register("Val1", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(1)));

        public double Val2
        {
            get { return (double)GetValue(Val2Property); }
            set { SetValue(Val2Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val2Property = DependencyProperty.Register("Val2", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(2)));

        public double Val3
        {
            get { return (double)GetValue(Val3Property); }
            set { SetValue(Val3Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val3Property = DependencyProperty.Register("Val3", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(3)));

        public double Val4
        {
            get { return (double)GetValue(Val4Property); }
            set { SetValue(Val4Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val4Property = DependencyProperty.Register("Val4", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(4)));

        public double Val5
        {
            get { return (double)GetValue(Val5Property); }
            set { SetValue(Val5Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val5Property = DependencyProperty.Register("Val5", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(5)));

        public double Val6
        {
            get { return (double)GetValue(Val6Property); }
            set { SetValue(Val6Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val6Property = DependencyProperty.Register("Val6", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(6)));

        public double Val7
        {
            get { return (double)GetValue(Val7Property); }
            set { SetValue(Val7Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val7Property = DependencyProperty.Register("Val7", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(7)));

        public double Val8
        {
            get { return (double)GetValue(Val8Property); }
            set { SetValue(Val8Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val8Property = DependencyProperty.Register("Val8", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(8)));

        public double Val9
        {
            get { return (double)GetValue(Val9Property); }
            set { SetValue(Val9Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val9Property = DependencyProperty.Register("Val9", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(9)));

        public double Val10
        {
            get { return (double)GetValue(Val10Property); }
            set { SetValue(Val10Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val10Property = DependencyProperty.Register("Val10", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(10)));

        public double Val11
        {
            get { return (double)GetValue(Val11Property); }
            set { SetValue(Val11Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val11Property = DependencyProperty.Register("Val11", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(11)));

        public double Val12
        {
            get { return (double)GetValue(Val12Property); }
            set { SetValue(Val12Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val12Property = DependencyProperty.Register("Val12", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(12)));

        public double Val13
        {
            get { return (double)GetValue(Val13Property); }
            set { SetValue(Val13Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val13Property = DependencyProperty.Register("Val13", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(13)));

        public double Val14
        {
            get { return (double)GetValue(Val14Property); }
            set { SetValue(Val14Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val14Property = DependencyProperty.Register("Val14", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(14)));

        public double Val15
        {
            get { return (double)GetValue(Val15Property); }
            set { SetValue(Val15Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val15Property = DependencyProperty.Register("Val15", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(15)));

        public double Val16
        {
            get { return (double)GetValue(Val16Property); }
            set { SetValue(Val16Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val16Property = DependencyProperty.Register("Val16", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(16)));

        public double Val17
        {
            get { return (double)GetValue(Val17Property); }
            set { SetValue(Val17Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val17Property = DependencyProperty.Register("Val17", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(17)));

        public double Val18
        {
            get { return (double)GetValue(Val18Property); }
            set { SetValue(Val18Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val18Property = DependencyProperty.Register("Val18", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(18)));

        public double Val19
        {
            get { return (double)GetValue(Val19Property); }
            set { SetValue(Val19Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val19Property = DependencyProperty.Register("Val19", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(19)));

        public double Val20
        {
            get { return (double)GetValue(Val20Property); }
            set { SetValue(Val20Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val20Property = DependencyProperty.Register("Val20", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(20)));

        public double Val21
        {
            get { return (double)GetValue(Val21Property); }
            set { SetValue(Val21Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val21Property = DependencyProperty.Register("Val21", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(21)));

        public double Val22
        {
            get { return (double)GetValue(Val22Property); }
            set { SetValue(Val22Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val22Property = DependencyProperty.Register("Val22", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(22)));

        public double Val23
        {
            get { return (double)GetValue(Val23Property); }
            set { SetValue(Val23Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val23Property = DependencyProperty.Register("Val23", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(23)));

        public double Val24
        {
            get { return (double)GetValue(Val24Property); }
            set { SetValue(Val24Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val24Property = DependencyProperty.Register("Val24", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(24)));

        public double Val25
        {
            get { return (double)GetValue(Val25Property); }
            set { SetValue(Val25Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val25Property = DependencyProperty.Register("Val25", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(25)));

        public double Val26
        {
            get { return (double)GetValue(Val26Property); }
            set { SetValue(Val26Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val26Property = DependencyProperty.Register("Val26", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(26)));

        public double Val27
        {
            get { return (double)GetValue(Val27Property); }
            set { SetValue(Val27Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val27Property = DependencyProperty.Register("Val27", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(27)));

        public double Val28
        {
            get { return (double)GetValue(Val28Property); }
            set { SetValue(Val28Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val28Property = DependencyProperty.Register("Val28", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(28)));

        public double Val29
        {
            get { return (double)GetValue(Val29Property); }
            set { SetValue(Val29Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val29Property = DependencyProperty.Register("Val29", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(29)));

        public double Val30
        {
            get { return (double)GetValue(Val30Property); }
            set { SetValue(Val30Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val30Property = DependencyProperty.Register("Val30", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(30)));

        public double Val31
        {
            get { return (double)GetValue(Val31Property); }
            set { SetValue(Val31Property, value); }
        }

        // Using a DependencyProperty as the backing store for Val.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Val31Property = DependencyProperty.Register("Val31", typeof(double), typeof(CustomShaderEffect),
            new UIPropertyMetadata(0.0, PixelShaderConstantCallback(31)));




    }
}
